package com.itheima.string;

import java.util.Scanner;

public class Replaceplus {
    public static void main(String[] args) {


    Scanner sc = new Scanner(System.in);
    String  str = sc.nextLine();
    String res= str;
    String [] arr = {"TMD","SB","NMD","NMSL","TM"};
        boolean sb = str.contains("SB");
        System.out.println("sb = " + sb);
        for (int i = 0; i < arr.length; i++) {
            String code = arr[i];
            res = res.replace(code,"***");
        }
        System.out.println(res);

}
}